package com.elink.enginerring.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
/**
 * 读取配置文件
 * @author Rick
 *
 */
public class ConfigUtil {
	private static Properties prop = new Properties();
	static {
		InputStream in = ConfigUtil.class.getClassLoader().getResourceAsStream("config.properties");
		try {
			prop.load(in);
		} catch (IOException e) {
			throw new RuntimeException("A error happens when reading config.properties", e);
		}
	}

	public static String getValue(String key) {
		return prop.getProperty(key);
	}
	
	public static boolean getBooleanValue(String key) {
		if("true".equals(prop.getProperty(key))){
			return true;
		}
		return false;
	}
}